package com.spring.arch.operation.tenant.model;

import com.spring.arch.common.jpa.model.AbstractAuditableModel;
import com.spring.arch.common.jpa.model.AbstractAuditableModel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 租客发票信息
 * @author Frank
 * @version 1.0.0
 * @since 2020/3/23
 */
@NoArgsConstructor
@Getter
@Setter
@Entity
@Table(name = "tenant_lessee_invoice")
public class LesseeInvoice extends AbstractAuditableModel {
    private static final long serialVersionUID = -7398959622438068504L;

    /**
     * 所属租客
     */
    @NotNull
    @ManyToOne(fetch = FetchType.LAZY)
    private Lessee lessee;

    /**
     * 开票信息单位名称
     */
    @Size(max = 64)
    private String companyName;

    /**
     * 税号
     */
    @Size(max = 32)
    private String dutyNo;

    /**
     * 注册地址
     */
    @Size(max = 128)
    private String registerAddress;

    /**
     * 联系电话
     */
    @Size(max = 32)
    private String telephone;

    /**
     * 开户行
     */
    @Size(max = 64)
    private String openingBank;

    /**
     * 银行账号
     */
    @Size(max = 64)
    private String openingBankAccount;

    /**
     * 是否默认
     */
    @NotNull
    private boolean defaultInvoice;
}
